home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 2 / Mac Magazin and MacEasy Magazine CD - Issue 02.iso / CD Extras / The Cruncher 1.1 Demo folder / Tutorial Folder / Cruncher Candy / Cruncher Candy.rsrc / TEXT_128.txt < prev    next >
Text File  |  1994-04-15  |  22KB  |  1,069 lines

  1. /* Candybars.s - tutorial 12/16/93 FINAL */
  2.  
  3.  
  4. play(;i)
  5. {
  6.     gSndChannel = 0;
  7.     gCurCheck = 1;
  8.     
  9.     MenusOnOff(0);    /* turn off menus */
  10.     MakeCheckBoxes();
  11.  
  12.     StartBtn = NewAnimation(290, 218, 10, 2);
  13.     ContinueBtn = NewAnimation(230, 470, 12, 2);
  14.     gAlreadyStarted = 0;
  15.     
  16.     Pointer = NewAnimation(ARecX(StartBtn)-41, ARecY(StartBtn)+6, 20, 2);
  17.     SheBop = NewAnimation(0, -200, 2, 1);
  18.     SheBopSpeech = NewAnimation(0, -200, 2, 1);
  19.     
  20.     gWaitFireClick = 0;
  21.     gFireCount = 0;
  22.     FireEngine = NewAnimation(0, -200, 174, 1);
  23.     FireBalloon = NewAnimation(0, -200, 190, 1);
  24.     FireLight1 = NewAnimation(0, -200, 182, 1);
  25.     FireLight2 = NewAnimation(0, -200, 182, 1);
  26.     FireSpeech = NewAnimation(0, -200, 2, 1);
  27.     FireClickMe = NewAnimation(0, -200, 210, 1);
  28.  
  29.     SetIdle(5, "OpeningIdle");
  30. }
  31. /*-----------------------*/
  32. OpeningIdle()
  33. {
  34. HoldMouseDowns(1);
  35.     CancelIdle("OpeningIdle");
  36. HoldMouseDowns(0);
  37.     DooWopQuickLick3();
  38. }
  39. /*************** FIRE ERROR STUFF ********************/
  40. FireError(errCode; )
  41. {
  42.     /* 101 => wrong cell */
  43.     /* 102 => bad entry */
  44.     /* 101 => missing (=) */
  45.     
  46.     gFireCount += 1;
  47.     if ((errCode != 101) || (gFireCount >= 2)) {
  48. HoldMouseDowns(1);
  49. DisableActions();
  50.         gFireCount = 0;
  51.         SetIdle(2, "FireIdle");
  52.         gFireCode = errCode;
  53.         gWaitFireClick = 1;
  54.     } else
  55.         DoBeep();
  56. }
  57. /*-----------------------*/
  58. FireIdle(errCode; )
  59. {
  60.     CancelIdle("FireIdle");
  61.     ZapSheBop();
  62.     FireEntrance(gFireCode);
  63.  
  64.     gWaitFireClick = 1;
  65. }
  66. /*-----------------------*/
  67. FireEntrance(errCode; right, width)
  68. {
  69. HoldMouseDowns(1);
  70.     right = GetSSRight();
  71.     gWidth = right - GetSSLeft();
  72.     
  73.     AMoveTo(FireEngine, right-(gWidth/2) + 40, GetSSBottom()-72);
  74.     Wait(FireEngine);
  75.     gSndChannel = PlayConsecutiveSound(92, gSndChannel);    /* Scram */    
  76.     AMove(FireEngine, -60, 0);
  77.     Wait(FireEngine);
  78.     gSndChannel = PlayConsecutiveSound(204, gSndChannel);    /* whistle */    
  79.     SetSprite(FireEngine, 172);
  80.     AMoveTo(FireBalloon, ARecX(FireEngine)-154, ARecY(FireEngine)-61);
  81.     Wait(FireBalloon);
  82.  
  83.     AMoveTo(FireLight1, ARecX(FireBalloon)+142, ARecY(FireBalloon)+65);
  84.     AMoveTo(FireLight2, ARecX(FireBalloon)+9, ARecY(FireBalloon)+65);
  85.  
  86.     SetSprite(FireSpeech, 190 + 2*(errCode-100));
  87.     AMoveTo(FireSpeech, ARecX(FireBalloon)+10, ARecY(FireBalloon)+14);
  88.     AMoveTo(FireClickMe, ARecX(FireBalloon)+35, ARecY(FireBalloon)+68);
  89.  
  90.     Wait(FireBalloon);
  91.     Wait(FireSpeech);
  92.     Wait(FireClickMe);
  93.     Wait(FireLight1);
  94.     Wait(FireLight2);
  95.     SetIdle(20, "DoFireLight");
  96. EnableActions();
  97. HoldMouseDowns(0);
  98. }
  99. /*-----------------------*/
  100. FireExit( ; x, y)
  101. {
  102. HoldMouseDowns(1);
  103.     CancelIdle("DoFireLight");    
  104.     x = ARecX(FireEngine);
  105.     y = ARecY(FireEngine);
  106.     if ((x > 0) && (y > 0)) {
  107.         AMoveTo(FireClickMe, 0, -200);
  108.         AMoveTo(FireSpeech, 0, -200);
  109.         AMoveTo(FireLight1, 0, -200);
  110.         AMoveTo(FireLight2, 0, -200);
  111.         Wait(FireLight1);
  112.         Wait(FireLight2);
  113.         AMoveTo(FireBalloon, 0, -200);
  114.     
  115.         gSndChannel = PlayConsecutiveSound(91, gSndChannel);    /* triangle */    
  116.         Wait(FireBalloon);
  117.     
  118.         SetSprite(FireEngine, 174);
  119.         Wait(FireEngine);
  120.         gSndChannel = PlayConsecutiveSound(92, gSndChannel);    /* Scram */    
  121.         AMove(FireEngine, -(gWidth/6), 0);
  122.         AMoveTo(FireEngine, 0, -200);
  123.     }
  124.     gWaitFireClick = 0;
  125. HoldMouseDowns(0);
  126. }
  127. /*-----------------------*/
  128. FireExitIdle()
  129. {
  130.     CancelIdle("FireExitIdle");    
  131.     FireExit();
  132.     if (gCurCheck > 1)
  133.         SetIdle(5, "Blinker");
  134. }
  135. /*-----------------------*/
  136. DoFireLight()
  137. {
  138.     SetSprite(FireEngine, 174);
  139.     APause(FireEngine, 10);
  140.     SetSprite(FireEngine, 172);
  141.     SetSprite(FireLight2, 184);
  142.     SetSprite(FireLight2, 186);
  143.     SetSprite(FireLight2, 188);
  144.     SetSprite(FireLight2, 182);
  145.     APause(FireLight2, 4);
  146.     Wait(FireLight2);
  147.     SetSprite(FireLight1, 184);
  148.     SetSprite(FireLight1, 186);
  149.     SetSprite(FireLight1, 188);
  150.     SetSprite(FireLight1, 182);
  151.     Wait(FireLight1);
  152.     SetSprite(FireEngine, 174);
  153.     APause(FireEngine, 10);
  154.     SetSprite(FireEngine, 172);
  155.     
  156.     ResetIdle("DoFireLight");
  157. }
  158. /**********************************************************/
  159.  
  160. /*-----------------------*/
  161. WaitASec(a, howMany)
  162. {
  163.     APause(a, howMany*60);
  164.     Wait(a);
  165.  
  166. }
  167. /*-----------------------*/
  168. animate_click(;a,handled,mode)
  169. {
  170.     handled = 0;
  171.     a = CurrentSprite();
  172.     
  173.     if (gWaitFireClick) {
  174.         SetIdle(2, "FireExitIdle");
  175. //        FireExit();
  176.         handled = 1;
  177.     } else if ((a == StartBtn) && (!gAlreadyStarted)) {
  178.         handled = 1;
  179.         DoStartBtn();
  180.         gAlreadyStarted = 1;
  181.     } else if ((a == ContinueBtn) && (gAlreadyStarted == 1)) {
  182.         handled = 1;
  183.         DoContinueBtn();
  184.         gAlreadyStarted = 2;
  185.     } else if ((a == SheBop)) {
  186.         mode = rand(3);
  187.         SheBopDanceStart(mode);
  188.         SheBopDance(mode);
  189.         handled = 1;
  190.     } else if ((a == GetStickerAnim(3, 2))) {
  191.         DooWopPlay();
  192.         handled = 1;
  193.     } else if ((a == GetStickerAnim(5, 2))) {
  194.         DooWopQuickLick1();
  195.         handled = 1;
  196.     } else if ((a == GetStickerAnim(4, 2))) {
  197.         DooWopQuickLick2();
  198.         handled = 1;
  199.     } else if ((a == GetStickerAnim(12, 2))) {
  200.         DooWopQuickLick3();
  201.         handled = 1;
  202.     } else if (a == SheBopSpeech) {
  203. //        SetSprite(SheBopSpeech, 2);
  204.         AMoveTo(SheBopSpeech, 100, -200);
  205.         handled = 1;
  206.     } 
  207.  
  208.     return(handled);
  209. }
  210. /*-----------------------*/
  211. formulaBar_enter(; result)
  212. {
  213. /*    DebugCode(gCurCheck); */
  214.     if (gCurCheck==2) {
  215.         Step2();
  216.     } else if (gCurCheck==4) {                            /* B6 */
  217.         result = CompareCellText(1, 5, "38");
  218.         if (result) {
  219.             FireError(result);
  220.         } else
  221.             Step4();
  222.     } else if (gCurCheck==6) {                            /* C6 */
  223.         result = CompareCellText(2, 5, "=38*.75");
  224.         if (result) {
  225.             result = CompareCellText(2, 5, "=.75*38");
  226.             if (result)
  227.                 FireError(result);
  228.         }
  229.         if (!result)
  230.             Step6();
  231.     } else if (gCurCheck==8) {                            /* B5 */
  232.         result = CompareCellText(1, 4, "50");
  233.         if (result) {
  234.             FireError(result);
  235.         } else
  236.             Step8();
  237.     } else if (gCurCheck==10) {                            /* B6 */
  238.         result = CompareCellText(1, 5, "45");
  239.         if (result) {
  240.             FireError(result);
  241.         } else
  242.             Step10();
  243.     } else if (gCurCheck==12) {                            /* C6 */
  244.         result = CompareCellText(2, 5, "=.75*B6");
  245.         if (result) {
  246.             result = CompareCellText(2, 5, "=B6*.75");
  247.             if (result)
  248.                 FireError(result);
  249.         }
  250.         if (!result)
  251.             Step12();
  252.     } else if (gCurCheck==14) {                            /* B6 */
  253.         result = CompareCellText(1, 5, "50");
  254.         if (result) {
  255.             FireError(result);
  256.         } else
  257.             Step14();
  258.     }
  259.  
  260.     
  261.     return(1);
  262. }
  263.  
  264.  
  265. /*-----------------------*/
  266. verify_stickerDrag(;result)
  267. {
  268.     if (gCurCheck>15)
  269.         result = 1;
  270.     else
  271.         result = 0;
  272.     return(result);
  273. }
  274. /*-----------------------*/
  275. verify_resizeRowCol(;result)
  276. {
  277.     result = 0;
  278.     if (gCurCheck > 15)
  279.         result = 99;
  280.     else
  281.         result = 0;
  282.     return(result);
  283. }
  284. /*-----------------------*/
  285. menu_select(;menuID, result)
  286. {
  287.     result = 1;
  288.     menuID = GetLastMenuID();
  289.     if ((menuID > 2) && (gCurCheck<15))
  290.         result = 0;
  291.     return(result);
  292. }
  293. /*-----------------------*/
  294. verify_fSelect()
  295. {
  296.     if (gWaitFireClick) {
  297.         DoBeep();
  298.         result = TestFSelRect(-2,-2,-2,-2);
  299.     }
  300.  
  301.     return(1);
  302. }
  303. /*-----------------------*/
  304. formulaBar_type(; row, col, result)
  305. {
  306.     result = 0;
  307.     row = GetCurCellRow();
  308.     col = GetCurCellCol();
  309.     
  310.     if (gCurCheck>15) {
  311.         result = 1;
  312.     } else if (gWaitFireClick) {
  313.         DoBeep();
  314. //        SetIdle(2, "FireExitIdle");
  315.     } else if ((col == 0) && (row == 5)) {        /* user's name */
  316.         result = 1;
  317.     } else if (gCurCheck==4) {
  318.         if ((col == 1) && (row == 5)) {
  319.             result = 1;
  320.         } else
  321.             result = 0;
  322.     } else if (gCurCheck==6) {
  323.         if ((col == 2) && (row == 5)) {
  324.             result = 1;
  325.         } else
  326.             result = 0;
  327.     } else if (gCurCheck==8) {
  328.         if ((col == 1) && (row == 4)) {
  329.             result = 1;
  330.         } else
  331.             result = 0;
  332.     } else if (gCurCheck==10) {
  333.         if ((col == 1) && (row == 5)) {
  334.             result = 1;
  335.         } else
  336.             result = 0;
  337.     } else if (gCurCheck==12) {
  338.         if ((col == 2) && (row == 5)) {
  339.             result = 1;
  340.         } else
  341.             result = 0;
  342.     } else if (gCurCheck==14) {
  343.         if ((col == 1) && (row == 5)) {
  344.             result = 1;
  345.         } else
  346.             result = 0;
  347.     }
  348.     if ((result == 0) && !gWaitFireClick)
  349.         FireError(101);
  350.  
  351.     SetFTypingVerified(result);
  352.     
  353.     return(1);
  354. }
  355.  
  356. /*-----------------------*/
  357. DoStartBtn(;a)
  358. {
  359. HoldMouseDowns(1);
  360.     AMoveTo(Pointer, ARecX(ContinueBtn)-41, ARecY(ContinueBtn)+6);
  361.     Wait(Pointer);
  362.     NBScrollForRange(16, 32);
  363. HoldMouseDowns(0);
  364. }
  365. /*-----------------------*/
  366. DoContinueBtn(;a)
  367. {
  368. HoldMouseDowns(1);
  369.     a = GetCheckBox(gCurCheck);
  370.     AMoveTo(Pointer, ARecX(a)-41, ARecY(a)-4);
  371.     Wait(Pointer);
  372.     gSndChannel = PlayConsecutiveSound(90, gSndChannel);    /* saxScram */    
  373.     NBArrangeWindow(234, 33);
  374.  
  375.     UnderlineCheckText(gCurCheck);
  376.     gBlinkState = 1;
  377.     
  378.     SetIdle(30, "Blinker");
  379.     SetIdle(2, "Step1");
  380.  
  381. // HoldMouseDowns(0);
  382. }
  383. /*-----------------------*/
  384. CheckCurBox(halfSecs, whichBox;a, ticks)
  385. {
  386.     a = GetCheckBox(whichBox);
  387.     gSndChannel = PlayConsecutiveSound(100, gSndChannel);    /* check */    
  388.     SetSprite(a, 152);
  389.     ticks = 30 * halfSecs;
  390.     if (ticks > 0)
  391.         APause(a, ticks);
  392.     SetSprite(a, 152);
  393.     Wait(a);
  394. }
  395. /*-----------------------*/
  396. DoCheckBox(halfSecs, whichBox ;a)
  397. {
  398.     SetSprite(Pointer, 22);
  399.     APause(Pointer, 10);
  400.     Wait(Pointer);
  401.     SetSprite(Pointer, 20);
  402.     CheckCurBox(halfSecs, whichBox);
  403. }
  404. /*-----------------------*/
  405. PointToNextStep(;a)
  406. {
  407.     a = GetCheckBox(gCurCheck);
  408.     SetSprite(Pointer, 22);
  409.     AMoveTo(Pointer, ARecX(a)-41, ARecY(a)-4);
  410.     APause(Pointer, 40);
  411.     Wait(Pointer);
  412.     SetSprite(Pointer, 20);
  413.     Wait(Pointer);
  414.     UnderlineCheckText(gCurCheck);
  415.     gBlinkState = 1;
  416.     
  417.     SetIdle(5, "Blinker");
  418. }
  419. /*-----------------------*/
  420. Blinker()
  421. {
  422. //HoldMouseDowns(1);
  423.     if (!gWaitFireClick) {
  424.         UnderlineCheckText(gCurCheck);
  425.         if (gBlinkState == 1) {
  426.             gBlinkState = 0;
  427.             SetIdle(3, "Blinker");
  428.         } else {
  429.             gBlinkState = 1;
  430.             SetIdle(40, "Blinker");
  431.         }
  432.     }
  433. //HoldMouseDowns(0);
  434. }
  435. /*-----------------------*/
  436. KillBlinker(whichBox)
  437. {
  438.     CancelIdle("Blinker");    
  439.     if (gBlinkState == 1) {
  440.         UnderlineCheckText(whichBox);
  441.         gBlinkState = 0;
  442.     }
  443. }
  444. /*-----------------------*/
  445. SheBopIntro(phrase)
  446. {
  447.     if ((phrase <= 0) || (phrase == 2)) {
  448.         gSndChannel = PlayConsecutiveSound(201, gSndChannel);    /* triangle */    
  449.     } else if (phrase == 1) {
  450.         gSndChannel = PlayConsecutiveSound(90, gSndChannel);    /* saxScram */    
  451.         gSndChannel = PlayConsecutiveSound(91, gSndChannel);    /* triangle2 */    
  452.     }
  453. }
  454. /*-----------------------*/
  455. SheBopMusic(phrase)
  456. {
  457.     if (phrase <= 0) {
  458.         gSndChannel = PlayConsecutiveSound(205, gSndChannel);    /* congas 1 */    
  459.         gSndChannel = PlayConsecutiveSound(206, gSndChannel);    /* congas 2 */    
  460.     } else if (phrase == 1) {
  461.         gSndChannel = PlayConsecutiveSound(206, gSndChannel);    /* congas 2 */    
  462.         gSndChannel = PlayConsecutiveSound(207, gSndChannel);    /* congas 3 */    
  463.     } else if (phrase == 2) {
  464.         gSndChannel = PlayConsecutiveSound(205, gSndChannel);    /* congas 1 */    
  465.         gSndChannel = PlayConsecutiveSound(206, gSndChannel);    /* congas 2 */    
  466.         gSndChannel = PlayConsecutiveSound(207, gSndChannel);    /* congas 3 */    
  467.     }
  468. }
  469. /*-----------------------*/
  470. SheBopOutro(phrase)
  471. {
  472.     if ((phrase <= 0) || (phrase == 2)) {
  473.         gSndChannel = PlayConsecutiveSound(204, gSndChannel);    /* whistle */    
  474.     } else if (phrase == 1) {
  475.         gSndChannel = PlayConsecutiveSound(200, gSndChannel);    /* shaker */    
  476.     }
  477. }
  478. /*-----------------------*/
  479. SheBopDanceStart(mode;)
  480. {
  481.     Wait(SheBop);
  482.     SheBopIntro(mode);
  483.     
  484.     SetSprite(SheBop, 104);
  485.     SetSprite(SheBop, 108);
  486.     APause(SheBop, 10);
  487.     Wait(SheBop);
  488.     SetSprite(SheBop, 104);
  489.     SetSprite(SheBop, 102);
  490.     Wait(SheBop);
  491.     SetSprite(SheBop, 102);
  492.     while(SoundsToPlay(gSndChannel)) {} ;
  493. }
  494. /*-----------------------*/
  495. SheBopDance(mode;)
  496. {
  497.     SetSprite(SheBop, 104);
  498.     Wait(SheBop);
  499.     SheBopMusic(mode);
  500.     SetSprite(SheBop, 104);
  501.     SetSprite(SheBop, 106);
  502.     SetSprite(SheBop, 104);
  503.     SetSprite(SheBop, 106);
  504.     while(SoundsToPlay(gSndChannel))
  505.     {    
  506.         SetSprite(SheBop, 108);
  507.         SetSprite(SheBop, 110);
  508.         Wait(SheBop);
  509.         SetSprite(SheBop, 110);
  510.     }
  511.     SheBopOutro(mode);
  512.     SetSprite(SheBop, 106);
  513.     SetSprite(SheBop, 104);
  514.     SetSprite(SheBop, 102);
  515. }
  516. /*-----------------------*/
  517. SheBopPuzzled(;saveDelay)
  518. {
  519.     saveDelay = GetADelay();
  520.     SetADelay(8);
  521.     
  522.     Wait(SheBop);
  523.     gSndChannel = PlayConsecutiveSound(90, gSndChannel);    /* saxScram */    
  524.     gSndChannel = PlayConsecutiveSound(91, gSndChannel);    /* triangle2 */    
  525.     
  526.     SetSprite(SheBop, 104);
  527.     SetSprite(SheBop, 108);
  528.     SetSprite(SheBop, 104);
  529.     SetSprite(SheBop, 102);
  530.     Wait(SheBop);
  531.     while(SoundsToPlay(gSndChannel)) {} ;    
  532.  
  533.     gSndChannel = PlayConsecutiveSound(204, gSndChannel);    /* whistle */    
  534.     SetSprite(SheBop, 114);
  535.  
  536.     APause(SheBop, 120);
  537.     SetSprite(SheBop, 114);
  538.     SetADelay(saveDelay);
  539. }
  540. /*-----------------------*/
  541. ZapSheBop()
  542. {
  543. //    SetSprite(SheBop, 2);
  544. //    SetSprite(SheBopSpeech, 2);
  545.     AMoveTo(SheBopSpeech, 0, -200);
  546.     AMoveTo(SheBop, 0, -200);
  547. }    
  548.  
  549. /*-----------------------*/
  550. DooWopQuickLick1(; a, saveID, saveDelay)
  551. {
  552.     saveDelay = GetADelay();
  553.     SetADelay(16);
  554.  
  555.     a = GetStickerAnim(5, 2);
  556.     saveID = AGetSpriteID(a);
  557.  
  558.  
  559.     SetSprite(a, 124);
  560.     Wait(a);
  561.     gSndChannel = PlayConsecutiveSound(112, gSndChannel);    /* riff 3 */    
  562.     SetSprite(a, 126);
  563.     SetSprite(a, 124);
  564.     SetSprite(a, 126);
  565.     SetSprite(a, 124);
  566.     Wait(a);
  567.     while(SoundsToPlay(gSndChannel)) {} ;    
  568.  
  569.     SetSprite(a, 130);
  570.     Wait(a);
  571.     gSndChannel = PlayConsecutiveSound(114, gSndChannel);    /* squeeky drop */    
  572.     SetSprite(a, 126);
  573.     SetSprite(a, 124);
  574.     Wait(a);
  575.     while(SoundsToPlay(gSndChannel)) {} ;    
  576.  
  577.     SetSprite(a, 122);
  578.     Wait(a);
  579.     
  580.     SetADelay(saveDelay);
  581. }
  582. /*-----------------------*/
  583. DooWopQuickLick2(; a, saveID, saveDelay)
  584. {
  585.     saveDelay = GetADelay();
  586.     SetADelay(15);
  587.  
  588.     a = GetStickerAnim(4, 2);
  589.     saveID = AGetSpriteID(a);
  590.  
  591.  
  592.     SetSprite(a, 126);
  593.     Wait(a);
  594.     gSndChannel = PlayConsecutiveSound(113, gSndChannel);    /* squeek up */    
  595.     SetSprite(a, 130);
  596.     SetSprite(a, 126);
  597.     SetSprite(a, 124);
  598.     Wait(a);
  599.     while(SoundsToPlay(gSndChannel)) {} ;    
  600.  
  601.     SetSprite(a, 126);
  602.     Wait(a);
  603.     gSndChannel = PlayConsecutiveSound(117, gSndChannel);    /* zot! */    
  604.     while(SoundsToPlay(gSndChannel)) {} ;    
  605.  
  606.     SetSprite(a, 122);
  607.     Wait(a);
  608.     
  609.     SetADelay(saveDelay);
  610. }
  611. /*-----------------------*/
  612. DooWopQuickLick3(; a, saveID, saveDelay)
  613. {
  614.     saveDelay = GetADelay();
  615.     SetADelay(16);
  616.  
  617.     a = GetStickerAnim(12, 2);
  618.     saveID = AGetSpriteID(a);
  619.  
  620.     SetSprite(a, 124);
  621.     Wait(a);
  622.     gSndChannel = PlayConsecutiveSound(110, gSndChannel);    /* riff 1a */    
  623.     SetSprite(a, 124);
  624.     SetSprite(a, 128);
  625.     SetSprite(a, 124);
  626.     Wait(a);
  627.     while(SoundsToPlay(gSndChannel)) {} ;    
  628. //    SetSprite(a, 122);
  629. //    Wait(a);
  630.  
  631.  
  632.     SetSprite(a, 124);
  633.     Wait(a);
  634.     gSndChannel = PlayConsecutiveSound(111, gSndChannel);    /* riff 1b */    
  635.     SetSprite(a, 126);
  636.     APause(a,20);
  637.     SetSprite(a, 124);
  638.     Wait(a);
  639.     while(SoundsToPlay(gSndChannel)) {} ;    
  640. //    SetSprite(a, 122);
  641. //    Wait(a);
  642.  
  643.  
  644.     SetSprite(a, 124);
  645.     Wait(a);
  646.     gSndChannel = PlayConsecutiveSound(112, gSndChannel);    /* riff 3 */    
  647.     SetSprite(a, 126);
  648.     SetSprite(a, 124);
  649.     SetSprite(a, 126);
  650.     SetSprite(a, 124);
  651.     Wait(a);
  652.     while(SoundsToPlay(gSndChannel)) {} ;    
  653.  
  654.     SetSprite(a, 126);
  655.     Wait(a);
  656.     gSndChannel = PlayConsecutiveSound(117, gSndChannel);    /* zot! */    
  657.     while(SoundsToPlay(gSndChannel)) {} ;    
  658.  
  659.     SetSprite(a, 122);
  660.     Wait(a);
  661.     
  662.     SetADelay(saveDelay);
  663. }
  664. /*-----------------------*/
  665. DooWopPlay(; a, saveID, saveDelay)
  666. {
  667.     saveDelay = GetADelay();
  668.     SetADelay(16);
  669.  
  670.     a = GetStickerAnim(3, 2);
  671.     saveID = AGetSpriteID(a);
  672.  
  673.     SetSprite(a, 124);
  674.     Wait(a);
  675.     gSndChannel = PlayConsecutiveSound(110, gSndChannel);    /* riff 1a */    
  676.     SetSprite(a, 124);
  677.     SetSprite(a, 128);
  678.     SetSprite(a, 124);
  679.     Wait(a);
  680.     while(SoundsToPlay(gSndChannel)) {} ;    
  681. //    SetSprite(a, 122);
  682. //    Wait(a);
  683.  
  684.  
  685.     SetSprite(a, 124);
  686.     Wait(a);
  687.     gSndChannel = PlayConsecutiveSound(111, gSndChannel);    /* riff 1b */    
  688.     SetSprite(a, 126);
  689.     APause(a,20);
  690.     SetSprite(a, 124);
  691.     Wait(a);
  692.     while(SoundsToPlay(gSndChannel)) {} ;    
  693. //    SetSprite(a, 122);
  694. //    Wait(a);
  695.  
  696.  
  697.     SetSprite(a, 124);
  698.     Wait(a);
  699.     gSndChannel = PlayConsecutiveSound(112, gSndChannel);    /* riff 3 */    
  700.     SetSprite(a, 126);
  701.     SetSprite(a, 124);
  702.     SetSprite(a, 126);
  703.     SetSprite(a, 124);
  704.     Wait(a);
  705.     while(SoundsToPlay(gSndChannel)) {} ;    
  706.  
  707.     SetSprite(a, 130);
  708.     Wait(a);
  709.     gSndChannel = PlayConsecutiveSound(115, gSndChannel);    /* drop */    
  710.     SetSprite(a, 126);
  711.     SetSprite(a, 124);
  712.     Wait(a);
  713.     while(SoundsToPlay(gSndChannel)) {} ;    
  714.     SetSprite(a, 126);
  715.     Wait(a);
  716.     gSndChannel = PlayConsecutiveSound(117, gSndChannel);    /* zot! */    
  717.     while(SoundsToPlay(gSndChannel)) {} ;    
  718.  
  719.     SetSprite(a, 122);
  720.     Wait(a);
  721.     
  722.     SetADelay(saveDelay);
  723. }
  724. /*-----------------------*/
  725. DooWopFinale(; a, saveID, saveDelay)
  726. {
  727.     saveDelay = GetADelay();
  728.     SetADelay(20);
  729.  
  730.     a = GetStickerAnim(3, 2);
  731.     saveID = AGetSpriteID(a);
  732.     SetSprite(a, 124);
  733.     Wait(a);
  734.     gSndChannel = PlayConsecutiveSound(112, gSndChannel);    /* riff 3 */    
  735.     SetSprite(a, 126);
  736.     APause(a,20);
  737.     SetSprite(a, 124);
  738.     Wait(a);
  739.     while(SoundsToPlay(gSndChannel)) {} ;
  740.     SetSprite(a, 122);
  741.     Wait(a);
  742.         
  743.     gCurCheck = 15;
  744.     UnderlineCheckText(gCurCheck);
  745.     CheckCurBox(3, gCurCheck);
  746.     UnderlineCheckText(gCurCheck);
  747.  
  748.     gCurCheck = gCurCheck + 1;
  749.     UnderlineCheckText(gCurCheck);
  750.     CheckCurBox(3, gCurCheck);
  751.     UnderlineCheckText(gCurCheck);
  752.  
  753.     gCurCheck = gCurCheck + 1;
  754.     UnderlineCheckText(gCurCheck);
  755.     CheckCurBox(3, gCurCheck);
  756.     UnderlineCheckText(gCurCheck);
  757.  
  758.  
  759.     APause(a,40);
  760.     SetSprite(a, 122);
  761.     Wait(a);
  762.     
  763.     DooWopPlay();
  764.     
  765.     SetADelay(saveDelay);
  766. }
  767. /*-----------------------*/
  768. CheckIt()
  769. {
  770.     gCurCheck = gCurCheck + 1;
  771.     KillBlinker(gCurCheck-1);
  772.     DoCheckBox(0, gCurCheck-1);
  773. }
  774.  
  775. /*-----------------------*/
  776. Step1(;row,col)
  777. {
  778. HoldMouseDowns(1);
  779.     row = GetCurCellRow();
  780.     col = GetCurCellCol();
  781.     if ((col == 0) && (row == 5)) {        /* A6 */
  782.         CancelIdle("Step1");    
  783.         CheckIt();
  784.         NBScrollForRange(34, 46);
  785.         PointToNextStep();
  786.         /* formulaBar_type & formulaBar_enter handle next step */
  787.         
  788.     } else
  789.         ResetIdle("Step1");
  790. HoldMouseDowns(0);
  791. }
  792. /*-----------------------*/
  793. Step2()
  794. {
  795. HoldMouseDowns(1);
  796.     CheckIt();
  797.     NBScrollForRange(42, 46);
  798.     PointToNextStep();
  799.  
  800.     SetIdle(2, "Step3");
  801. //HoldMouseDowns(0);
  802. }
  803. /*-----------------------*/
  804. Step3(;row,col)
  805. {
  806. HoldMouseDowns(1);
  807.     row = GetCurCellRow();
  808.     col = GetCurCellCol();
  809.     if ((col == 1) && (row == 5)) {        /* B6 */
  810.         CancelIdle("Step3");    
  811.         CheckIt();
  812.         NBScrollForRange(42, 46);
  813.         PointToNextStep();
  814.         /* formulaBar_type & formulaBar_enter handle next step */
  815.         
  816.     } else
  817.         ResetIdle("Step3");
  818. HoldMouseDowns(0);
  819. }
  820. /*-----------------------*/
  821. Step4()
  822. {
  823. HoldMouseDowns(1);
  824. DisableActions();
  825. //    CheckIt();
  826.     KillBlinker(gCurCheck);
  827.     DoCheckBox(0, gCurCheck);
  828.  
  829.     AMoveTo(SheBop, 216, 53);
  830.     SetSprite(SheBop, 102);
  831.     SheBopDanceStart(0);
  832.  
  833.     SetSprite(SheBopSpeech, 50);
  834.     AMoveTo(SheBopSpeech, 218, 2);
  835.     SheBopDance(1);
  836.  
  837.     WaitASec(SheBopSpeech, 2);
  838.     SetSprite(SheBopSpeech, 50);
  839.     Wait(SheBop);
  840.     NBScrollForRange(47, 58);
  841.     gCurCheck = gCurCheck + 1;
  842.     PointToNextStep();
  843.  
  844.     SetIdle(2, "Step5");
  845. // HoldMouseDowns(0);
  846. EnableActions();
  847. }
  848. /*-----------------------*/
  849. Step5(;row,col)
  850. {
  851. HoldMouseDowns(1);
  852.     row = GetCurCellRow();
  853.     col = GetCurCellCol();
  854.     if ((col == 2) && (row == 5)) {        /* C6 */
  855.         CancelIdle("Step5");    
  856.         gCurCheck = gCurCheck + 1;
  857.         ZapSheBop();
  858.         KillBlinker(gCurCheck-1);
  859.         DoCheckBox(0, gCurCheck-1);
  860.         NBScrollForRange(48, 58);
  861.         PointToNextStep();
  862.         /* formulaBar_type & formulaBar_enter handle next step */
  863.         
  864.     } else
  865.         ResetIdle("Step5");
  866. HoldMouseDowns(0);
  867. }
  868. /*-----------------------*/
  869. Step6()
  870. {
  871. DisableActions();
  872. HoldMouseDowns(1);
  873. //    CheckIt();
  874.     KillBlinker(gCurCheck);
  875.     DoCheckBox(0, gCurCheck);
  876.  
  877.     NBScrollForRange(62, 74);
  878.  
  879.     DooWopQuickLick1();
  880.     gCurCheck = gCurCheck + 1;
  881.     PointToNextStep();
  882.     SetIdle(2, "Step7");
  883.  
  884. // HoldMouseDowns(0);
  885. EnableActions();
  886. }
  887. /*-----------------------*/
  888. Step7(;row,col)
  889. {
  890. HoldMouseDowns(1);
  891.     row = GetCurCellRow();
  892.     col = GetCurCellCol();
  893.     if ((col == 1) && (row == 4)) {        /* B5 */
  894.         CancelIdle("Step7");    
  895.         CheckIt();
  896.         NBScrollForRange(63, 74);
  897.         PointToNextStep();
  898.         /* formulaBar_type & formulaBar_enter handle next step */
  899.         
  900.     } else
  901.         ResetIdle("Step7");
  902. HoldMouseDowns(0);
  903. }
  904. /*-----------------------*/
  905. Step8()
  906. {
  907. HoldMouseDowns(1);
  908. DisableActions();
  909. //    CheckIt();
  910.     KillBlinker(gCurCheck);
  911.     DoCheckBox(0, gCurCheck);
  912.  
  913.     AMoveTo(SheBop, 217, 50);
  914.     SetSprite(SheBop, 102);
  915.     SheBopDanceStart(0);
  916.  
  917.     SetSprite(SheBopSpeech, 56);
  918.     AMoveTo(SheBopSpeech, 194, 3);
  919.     SheBopDance(0);
  920.  
  921.     WaitASec(SheBopSpeech, 2);
  922.     SetSprite(SheBopSpeech, 56);
  923.     Wait(SheBop);
  924.     NBScrollForRange(70, 75);
  925.  
  926.     gCurCheck = gCurCheck + 1;
  927.     PointToNextStep();
  928.     SetIdle(2, "Step9");
  929.  
  930. // HoldMouseDowns(0);
  931. EnableActions();
  932. }
  933. /*-----------------------*/
  934. Step9(;row,col)
  935. {
  936. HoldMouseDowns(1);
  937.     row = GetCurCellRow();
  938.     col = GetCurCellCol();
  939.     if ((col == 1) && (row == 5)) {        /* B6 */
  940.         CancelIdle("Step9");    
  941.         ZapSheBop();
  942.         CheckIt();
  943.         NBScrollForRange(70, 75);
  944.         PointToNextStep();
  945.         /* formulaBar_type & formulaBar_enter handle next step */
  946.         
  947.     } else
  948.         ResetIdle("Step9");
  949. HoldMouseDowns(0);
  950. }
  951. /*-----------------------*/
  952. Step10()
  953. {
  954. HoldMouseDowns(1);
  955. DisableActions();
  956. //    CheckIt();
  957.     KillBlinker(gCurCheck);
  958.     DoCheckBox(0, gCurCheck);
  959.  
  960.     SetIdle(2, "Step11");
  961.  
  962.     AMoveTo(SheBop, 218, 54);
  963.     SetSprite(SheBop, 102);
  964.     SheBopPuzzled();
  965.  
  966.     SetSprite(SheBopSpeech, 52);
  967.     AMoveTo(SheBopSpeech, 225, 2);
  968.     APause(SheBopSpeech, 30);
  969.     Wait(SheBopSpeech);
  970.  
  971.     WaitASec(SheBopSpeech, 2);
  972.     SetSprite(SheBopSpeech, 52);
  973.     NBScrollForRange(77, 87);
  974.     gCurCheck = gCurCheck + 1;
  975.     PointToNextStep();
  976.     SetIdle(2, "Step11");
  977.  
  978. // HoldMouseDowns(0);
  979. EnableActions();
  980. }
  981. /*-----------------------*/
  982. Step11(;row,col)
  983. {
  984. HoldMouseDowns(1);
  985.     row = GetCurCellRow();
  986.     col = GetCurCellCol();
  987.     if ((col == 2) && (row == 5)) {        /* C6 */
  988.         CancelIdle("Step11");    
  989.         ZapSheBop();
  990.         CheckIt();
  991.         NBScrollForRange(77, 87);
  992.         PointToNextStep();
  993.         /* formulaBar_type & formulaBar_enter handle next step */
  994.         
  995.     } else
  996.         ResetIdle("Step11");
  997. HoldMouseDowns(0);
  998. }
  999. /*-----------------------*/
  1000. Step12()
  1001. {
  1002. HoldMouseDowns(1);
  1003. DisableActions();
  1004. //    CheckIt();
  1005.     KillBlinker(gCurCheck);
  1006.     DoCheckBox(0, gCurCheck);
  1007.  
  1008.     NBScrollForRange(90, 101);
  1009.  
  1010.     DooWopQuickLick2();
  1011.  
  1012.     gCurCheck = gCurCheck + 1;
  1013.     PointToNextStep();
  1014.     SetIdle(2, "Step13");
  1015.  
  1016. // HoldMouseDowns(0);
  1017. EnableActions();
  1018. }
  1019. /*-----------------------*/
  1020. Step13(;row,col)
  1021. {
  1022. HoldMouseDowns(1);
  1023.     row = GetCurCellRow();
  1024.     col = GetCurCellCol();
  1025.     if ((col == 1) && (row == 5)) {        /* B6 */
  1026.         CancelIdle("Step13");    
  1027.         CheckIt();
  1028.         NBScrollForRange(90, 101);
  1029.         PointToNextStep();
  1030.         /* formulaBar_type & formulaBar_enter handle next step */
  1031.         
  1032.     } else
  1033.         ResetIdle("Step13");
  1034. HoldMouseDowns(0);
  1035. }
  1036. /*-----------------------*/
  1037. Step14()
  1038. {
  1039. HoldMouseDowns(1);
  1040. DisableActions();
  1041.     CheckIt();
  1042.  
  1043.     AMoveTo(Pointer, -100, -100);
  1044.  
  1045.     AMoveTo(SheBop, 218, 52);
  1046.     SetSprite(SheBop, 102);
  1047.     SheBopDanceStart(2);
  1048.  
  1049.     SetSprite(SheBopSpeech, 54);
  1050.     AMoveTo(SheBopSpeech, 158, 16);
  1051.     SheBopDance(2);
  1052.  
  1053.     WaitASec(SheBopSpeech, 3);
  1054.     SetSprite(SheBopSpeech, 54);
  1055.     Wait(SheBop);
  1056.     NBScrollForRange(102, 112);
  1057.  
  1058.     DooWopFinale();
  1059.     
  1060.     MenusOnOff(1);    /* turn on menus */
  1061.  
  1062.     NBScrollForRange(103, 112);
  1063. EnableActions();
  1064. HoldMouseDowns(0);
  1065. }
  1066.  
  1067. /*-----------------------*/
  1068.  
  1069. Àá